# Maintainer: Thiago Perrotta <tbperrotta@gmail.com>
pkgname=kubeseal
pkgver=0.27.1
pkgrel=0
pkgdesc="A Kubernetes controller and tool for one-way encrypted Secrets"
url="https://github.com/bitnami-labs/sealed-secrets"
arch="all"
license="Apache-2.0"
makedepends="go"
subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/bitnami-labs/sealed-secrets/archive/v$pkgver/kubeseal-$pkgver.tar.gz"
options="net"
builddir="$srcdir/sealed-secrets-$pkgver"

build() {
	cd cmd/kubeseal
	export GOFLAGS="$GOFLAGS -mod=readonly"
	go build -ldflags="-linkmode=external -X=main.VERSION=v$pkgver" .
}

check() {
	go test -skip TestHttpCert ./cmd/kubeseal/... ./pkg/...
}

package() {
	install -Dm755 "cmd/kubeseal/$pkgname" "$pkgdir/usr/bin/$pkgname"
	install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

sha512sums="
ce339aa9c696678bc16171e59e9e9f4f078f9e5b5179a0c028b415f8f797cef5c7cc569abd71c3aa028f7e698f9b0f40c0ace7651f01d51db4c0fc29a934cfcc  kubeseal-0.27.1.tar.gz
"
